<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Called when creating the filter</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="php-user-filter.onclose.html">« php_user_filter::onClose</a></li>
      <li style="float: right;"><a href="class.streamwrapper.html">streamWrapper »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.php-user-filter.html">php_user_filter</a></li>
    <li>Called when creating the filter</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="php-user-filter.oncreate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">php_user_filter::onCreate</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">php_user_filter::onCreate</span> &mdash; <span class="dc-title">Called when creating the filter</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-php-user-filter.oncreate-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>php_user_filter::onCreate</strong></span>(): <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   This method is called during instantiation of the filter class
   object.  If your filter allocates or initializes any other resources
   (such as a buffer), this is the place to do it.
  </p>

  <p class="para">
   When your filter is first instantiated, and
   <code class="literal">yourfilter-&gt;onCreate()</code> is called, a number of properties
   will be available as shown in the table below.
  </p>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Property</th>
       <th>Contents</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td><code class="literal">FilterClass-&gt;filtername</code></td>
       <td>
        A string containing the name the filter was instantiated with.
        Filters may be registered under multiple names or under wildcards.
        Use this property to determine which name was used.
       </td>
      </tr>

      <tr>
       <td><code class="literal">FilterClass-&gt;params</code></td>
       <td>
        The contents of the <code class="parameter">params</code> parameter passed
        to <span class="function"><a href="function.stream-filter-append.html" class="function">stream_filter_append()</a></span>
        or <span class="function"><a href="function.stream-filter-prepend.html" class="function">stream_filter_prepend()</a></span>.
       </td>
      </tr>

      <tr>
       <td><code class="literal">FilterClass-&gt;stream</code></td>
       <td>
        The stream resource being filtered. Maybe available only during
        <span class="methodname"><strong>filter()</strong></span> calls when the 
        <code class="literal">closing</code> parameter is set to <strong><code>false</code></strong>.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-php-user-filter.oncreate-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-php-user-filter.oncreate-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Your implementation of
   this method should return <strong><code>false</code></strong> on failure, or <strong><code>true</code></strong> on success.
  </p>
 </div>



</div></div></div></body></html>